//
//  CDAPIManager.h
//  JJHW_coreData
// 用于管理所有的请求
//  Created by lizhenqiang on 16/4/7.
//  Copyright © 2016年 HFKJ_LZQ. All rights reserved.
//

#import <Foundation/Foundation.h>

#define KgetDefaultCountryTag 100//获取默认国家
#define KsplashTag 101 //分类菜单接口
#define KcityListTag 102 //城市列表
#define KcityImageTag 103 //获取城市推荐图片
#define KNewsListTag 104  //资讯列表接口
#define KNewsSearchTag 105 //资讯模糊搜索接口
#define KNewsDetailTag 106 //资讯详情接口

#define KGetTokenTag 107 //获取token
#define KLoginTag 108 //登录
#define KThirdLoginTag 109//第三方登录
#define KRegisterTag 110 //注册
#define KYanZhengMaTag 111//验证码
#define KForgetPasswdTag 112//忘记密码
#define KResetPasswdTag 113//重置密码
#define KEditUserHeadTag 114//编辑用户头像
#define KRegisterLastTag 115 //注册最后一步
#define KEditUserOtherInfoTag 116 //编辑用户的其他信息  邮箱 性别等
#define KBindThirdInfoTag 117 //手机号登录后 绑定第三方信息
#define KUpLoadImageTag 118 //上传图片接口


@interface CDAPIManager : NSObject
/**
 *  单例
 */
+ (instancetype)sharedManager;



#pragma mark jjhw 接口请求

/**
 *  请求默认的国家id countryid
 *
 *  @return <#return value description#>
 */
//-(void)request_getDefaultCountry_withParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error))block;
-(void)request_getDefaultCountry_withParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;

/**
 *  分类菜单接口
 *
 *  @param params <#params description#>
 *  @param block  <#block description#>
 */
- (void)request_splash_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;

/**
 *  城市列表
 *
 *  @param params <#params description#>
 *  @param block  <#block description#>
 */
- (void)request_cityList_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
/**
 *  城市图片接口
 *
 *  @param params <#params description#>
 *  @param block  <#block description#>
 */
-(void)request_cityImage_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
/**
 *  资讯列表接口
 *
 *  @param params <#params description#>
 *  @param block  <#block description#>
 */
-(void)request_newsList_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
/**
 *  资讯搜索
 *
 *  @param params <#params description#>
 *  @param block  <#block description#>
 */
-(void)request_newsSearch_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
/**
 *  资讯详情
 *
 *  @param params <#params description#>
 *  @param block  <#block description#>
 */
-(void)request_newsDetail_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
/**
 *  搜索列表接口
 */

/**
 *  非登录状态下获取 token和secret  接口比较特殊 不需要签名处理
 */
-(void)request_unLoginGetToken_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
//
///**
// *  手机号登录接口
// */
//-(void)request_Login_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  第三方登录
// */
//-(void)request_ThirdLogin_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  注册
// */
//-(void)request_Register_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// * 验证码
// */
//-(void)request_SendCode_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  忘记密码
// */
//-(void)request_ForgetPasswd_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  重置密码
// */
//-(void)request_ResetPasswd_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  编辑用户头像
// */
//-(void)request_EditUserHead_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  注册最后一步 编辑信息
// */
//-(void)request_RegisterLast_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  编辑用户信息 包括 性别 邮箱
// */
//-(void)request_EditUserOtherInfo_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  登录后绑定第三方信息
// */
//-(void)request_BindThirdInfo_WithParams:(id)params andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;
///**
// *  上传图片  接口特殊
// */

//所有的接口请求处理
-(void)request_AllHandle_WithParams:(id)params andApiTag:(int)tag andIsSign:(BOOL)flag andBlock:(void (^)(id data, NSError *error,BOOL isSuccess))block;

/**
 *  上传图片
 *
 *  @param params <#params description#>
 *  @param image  <#image description#>
 *  @param flag   <#flag description#>
 */
-(void)request_upLoadPhoto_WithParams:(id)params image:(UIImage *)image andIsSign:(BOOL)flag andSuccessBlock:(void (^)(id, NSError *))success failureBlock:(void (^)( NSError *))failure progerssBlock:(void (^)(CGFloat))progress;
-(void)upLoadImageRequest;
@end
